home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / misc / shadow.sty < prev    next >
Text File  |  1994-09-14  |  4KB  |  85 lines

  1. %%% ======================================================================
  2. %%%  @LaTeX-style{
  3. %%%     filename        = "shadow.sty",
  4. %%%     version         = "1.2",
  5. %%%     date            = "14 September 1994",
  6. %%%     time            = "11:32:22.56 CST",
  7. %%%     author          = "Mauro Orlandini",
  8. %%%     address         = "TeSRE Institute/CNR
  9. %%%                        Area della Ricerca di Bologna
  10. %%%                        Via Gobetti 101
  11. %%%                        40129 Bologna, Italy",
  12. %%%     e-mail          = "orlandini@botes1.tesre.bo.cnr.it (Internet)
  13. %%%                        38045::ORLANDINI (DECnet)",
  14. %%%     telephone       = "+39 51 639-8667",
  15. %%%     FAX             = "+39 51 639-8723",
  16. %%%     supported       = "yes",
  17. %%%     archived        = "SHSU*, ymir",
  18. %%%     keywords        = "LaTeX",
  19. %%%     abstract        = "The command \shabox has the same meaning of the
  20. %%%                        LaTeX command \fbox except for the fact that a
  21. %%%                        "shadow" is added to the bottom and the right side
  22. %%%                        of the box. It computes the right dimension of the
  23. %%%                        box, even if the text spans over more than one
  24. %%%                        line; in this case a warning messagge is given.",
  25. %%%     codetable       = "ISO/ASCII",
  26. %%%     checksum        = "20003 84 403 4299",
  27. %%%     docstring       = "There are three parameters governing:
  28. %%%                        1. the width of the lines delimiting the box:
  29. %%%                           \sboxrule
  30. %%%                        2. the separation between the edge of the box and
  31. %%%                           its contents: \sboxsep
  32. %%%                        3. the dimension of the shadow: \sdim
  33. %%%                        Sintax: \shabox{<text>}
  34. %%%                                where <text> is the text to be put in the
  35. %%%                                framed box. It can be an entire paragraph.
  36. %%%                        Adapted from the file dropshadow.tex by
  37. %%%                        drstrip@cd.sandia.gov.
  38. %%%                        V1.1  Works in a double column environment.
  39. %%%                        V1.2  When there is an online shadow box, it
  40. %%%                              will be centered on the line (in V1.1 the
  41. %%%                              box was aligned with the baseline).
  42. %%%                              (Courtesy by Mike Piff)",
  43. %%%                        
  44. %%%                        The checksum field above contains a CRC-16
  45. %%%                        checksum as the first value, followed by the
  46. %%%                        equivalent of the standard UNIX wc (word 
  47. %%%                        count) utility output of lines, words, and
  48. %%%                        characters.  This is produced by Robert 
  49. %%%                        Solovay's checksum utility."
  50. %%% }
  51. %%% ======================================================================
  52. %
  53. \typeout{Style Option: `shadow' v1.2 <14 September 1994> (M.O.)}
  54. \newdimen\txtwdth  \newdimen\sht  \newdimen\shw  \newbox\shbox
  55. \newdimen\sboxsep  \newdimen\sboxrule  \newdimen\sdim
  56. \sboxsep  = 10pt
  57. \sdim     = 4pt
  58. \sboxrule = .4pt
  59. \def\shabox#1{\setbox\@tempboxa\hbox{#1}
  60. \shw\wd\@tempboxa
  61. \if@twocolumn\txtwdth\columnwidth\else\txtwdth\textwidth\fi
  62. \ifdim\shw<\txtwdth 
  63.   \leavevmode\setbox\@tempboxa\hbox{#1}
  64. \else
  65.   \typeout{Shadow Warning: Box dimension greater than textwidth.}
  66.   \setbox\@tempboxa\vbox{\hsize\txtwdth\advance\hsize-2\sboxsep
  67.     \advance\hsize-2\sboxrule \advance\hsize-2\sdim \advance\hsize-15pt#1}
  68. \fi
  69.  \setbox\shbox\hbox{\@tempdima\sboxrule
  70.      \advance\@tempdima \sboxsep \advance\@tempdima \dp\@tempboxa
  71.     \hbox{\lower \@tempdima\hbox
  72.    {\vbox{\hrule \@height \sboxrule
  73.            \hbox{\vrule \@width \sboxrule \hskip\sboxsep
  74.           \vbox{\vskip\sboxsep \box\@tempboxa\vskip\sboxsep}\hskip
  75.               \sboxsep\vrule \@width \sboxrule}
  76.             \hrule \@height \sboxrule}}}}
  77. \sht\ht\shbox \advance\sht-\sdim
  78. \leavevmode\vbox{\baselineskip0pt\lineskip0pt\vtop{%%     V1.2
  79.                                                    %%     Added \vtop
  80.                                                    %%     From M.Piff
  81.              \hbox{\copy\shbox\vrule width\sdim height\sht}
  82.              \hbox{\kern\sdim\vrule height\sdim width \wd\shbox}}}}
  83.  
  84. \endinput
  85.